<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>这是index.html页面内容</h1>
    <button onclick="getHttp()">发送一个请求</button>
    <script>
        function getHttp() {

            var xhr = new XMLHttpRequest();
            xhr.onreadystatechange = function () {
                if (xhr.readyState === 4) {
                    console.log(xhr.responseText);
                }
            }

            xhr.open('get', 'http://localhost:3000/getOne');
            xhr.send();
        }
    </script>
</body>

</html>